package bean;

import dao.IDIF;

/**
 * This Bean keeps record of the last ID. 
 * We need this class because our BD solution do not provides an automatic mechanism to set ID (primary key)
 * @author Otavio Lima, Laura Dutra, Anne Lorayne
 *
 */
public class LastIdsBean implements IDIF {

	public String Id;
	public long lastBlogId;
	public long lastAnnouncementId;
	public long lastCommentId;
	public long lastMediaId;
	public long lastPostId;
	public long lastUserId;
	
	public LastIdsBean(){
		Id = "0";
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return Id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.Id = id;
	}
	
	public long getLastBlogId() {
		return lastBlogId;
	}

	public void setLastBlogId(long lastBlogId) {
		this.lastBlogId = lastBlogId;
	}

	public long getLastAnnouncementId() {
		return lastAnnouncementId;
	}

	public void setLastAnnouncementId(long lastAnnouncementId) {
		this.lastAnnouncementId = lastAnnouncementId;
	}

	public long getLastCommentId() {
		return lastCommentId;
	}

	public void setLastCommentId(long lastCommentId) {
		this.lastCommentId = lastCommentId;
	}

	public long getLastMediaId() {
		return lastMediaId;
	}

	public void setLastMediaId(long lastMediaId) {
		this.lastMediaId = lastMediaId;
	}

	public long getLastPostId() {
		return lastPostId;
	}

	public void setLastPostId(long lastPostId) {
		this.lastPostId = lastPostId;
	}

	public long getLastUserId() {
		return lastUserId;
	}

	public void setLastUserId(long lastUserId) {
		this.lastUserId = lastUserId;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null || !(obj instanceof LastIdsBean) )
			return false;
		LastIdsBean anotherLastIdsBean = (LastIdsBean) obj;
		
		if (this.getId().equals(anotherLastIdsBean.getId()))
			return true;
		
		return false;
	}
	
}
